package cn.yunhe.mybatis;

import cn.yunhe.dao.EmployeeMapper;
import cn.yunhe.model.Employee;
import cn.yunhe.util.SqlSessionFactoryUtil;
import org.apache.ibatis.session.SqlSession;
import org.apache.log4j.Logger;
import org.junit.Test;

/**
 * Created by zs on 2017/11/29.
 */
public class CasecadeDemo {
    SqlSession session = null;

    @Test
    public void test1() {
        try {
            Logger logger = Logger.getLogger(CasecadeDemo.class);
            session = SqlSessionFactoryUtil.getSqlSession();
            EmployeeMapper employeeMapper = session.getMapper(EmployeeMapper.class);
            Employee employee = employeeMapper.getEmployee(1L);

            logger.info(employee.getBirthday());
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            session.close();
        }


    }

}
